package cn.edu.scau.sec.caixiaoqing.adapter;

import java.util.Calendar;

public class ClassAdapter extends Adaptee implements Target{
    @Override
    public void printDate(String calendarString) {

        Calendar calendar = Calendar.getInstance();

        String[] split = calendarString.split("\\.");

        int year = Integer.parseInt(split[0]);
        int month = Integer.parseInt(split[1]);
        int day = Integer.parseInt(split[2]);

        calendar.set(year,month - 1,day);

        System.out.println("类适配器：");
        printCalendar(calendar);
    }
}
